#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>

//https://www.nowcoder.com/practice/bac5a2372e204b2ab04cc437db76dc4f?tpId=182&&tqId=34323&rp=1&ru=/ta/exam-all&qru=/ta/exam-all/question-ranking

int main() {
    long n, k = 0;
    while (~scanf("%ld %ld", &n, &k)) {
        if (k == 0) {
            printf("%ld\n", n * n);
            continue;
        }
        long count = (n - k) * (n - k + 1);
        for (int y = k + 1; y <= n; y++) {
            count -= (n / y) * k + (n % y >= k ? 0 : (n % y) - k + 1);
        }
        printf("%ld\n", count);
    }
    return 0;
}